package com.hero.jobweb.action.tag;

import org.apache.commons.lang.StringUtils;
import org.apache.struts2.components.Select;
import org.apache.struts2.views.jsp.ui.SelectTag;

/**
 * 下拉列表编码
 * @author Volcano
 *
 */
public class JobWebEditCodeTage extends SelectTag {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String mapMethodName;
	public String getMapMethodName() {
		return mapMethodName;
	}
	public void setMapMethodName(String mapMethodName) {
		this.mapMethodName = mapMethodName;
	}
	@Override
	protected void populateParams() {
        super.populateParams();

        Select select = ((Select) component);
        select.setEmptyOption(emptyOption);
        select.setList("@com.hero.jobweb.config.CacheData@"+mapMethodName+"()");
        select.setListKey("key");
        select.setListValue("value.name");
        if(StringUtils.isEmpty(headerKey)&&StringUtils.isEmpty(headerValue))
        {
        	 select.setHeaderKey("");
             select.setHeaderValue("--请选择--");
             return;
        }
        select.setHeaderKey(headerKey);
        select.setHeaderValue(headerValue);
    }
}
